#include<bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
long long n;
long long a[MAXN];
long long num;
bool vis[MAXN];
bool tp = false;
long long ans1,ans2;
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%lld",&n);
    num = n;
    for(long long i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        if(a[i] >= 3)
        {
            tp = true;
        }
    }
    if(!tp)
    {
        for(long long i=1;i<=n;i++)
        {
            if(a[i] == 1)
            {
                ans1++;
            }
            else
            {
                ans2++;
            }
        }
        printf("%lld",max(ans1,ans2));
        fclose(stdin);
        fclose(stdout);
        return 0;
    }
    sort(a+1,a+n+1);
    for(long long i=1;i<=n;i++)
    {
        for(long long j=i+1;j<=n;j++)
        {
            if(a[i] < a[j] && !vis[j])
            {
                //cout << i << " " << j << endl;
                a[i] = -1;
                num--;
                vis[j] = true;
                break;
            }
        }
    }
    printf("%lld",num);
    fclose(stdin);
    fclose(stdout);
    return 0;
}
